import React, {useEffect, useState} from "react";
import {Avatar, Button, Card, Divider, Dropdown, Icon, List, Menu, message, Modal, Tooltip, Upload} from "antd";
import {PageHeaderWrapper} from "@ant-design/pro-layout";
import styles from './index.less';

const {confirm} = Modal;

interface Props {
  location: Location
}

export const TenantContext = React.createContext({});

const Screen = (props: Props) => {

  // const url = "http://localhost:8080/#/deviceList?userId="+localStorage.getItem('user-name');
  const url = "http://222.88.186.81:23646/#/deviceList?userId="+localStorage.getItem('user-name');
  // const url = "http://"+window.location.hostname+":8866/#/deviceList";
  useEffect(() => {
    console.log('url',url)
    console.log('user-name',localStorage.getItem('user-name'))
    const w=window.open('about:blank');
    w.location.href=url
    window.history.back()
  }, []);

  return (
    <PageHeaderWrapper title="视频服务">
      <div className={styles.tableList}>
        <iframe className={styles.tableListOperator} src={url}></iframe>
      </div>
    </PageHeaderWrapper>
  )
};

export default Screen;
